package com.ws.shop.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.ws.shop.bean.Page;
import com.ws.shop.dao.PaymentDao;
import com.ws.shop.entity.Payment;
import com.ws.shop.service.PaymentService;

@Service(value="paymentService")
public class PaymentServiceImpl implements PaymentService {
	@Resource(name="paymentDao")
	private PaymentDao paymentDao;

	@Transactional(propagation=Propagation.NOT_SUPPORTED,readOnly=true)
	public Page findPaymentListPage(int pageno,int pagesize) {
		return paymentDao.findPaymentListPage(pageno,pagesize);
	}

	@Transactional(rollbackFor=Exception.class)
	public void saveOrUpdate(Payment payment) {
		paymentDao.saveOrUpdate(payment);
	}

	public Payment getPaymentByid(final int id ){
		return paymentDao.getPaymentByid(id);
	}
}
